<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title>Document</title>
  <style>
    
  </style>
</head>
<body>
  
</body>
<script>



  function createObj(name, age, sex){
    const obj = {
      myName:"obj",
      name,
      age,
      sex,
      show(){
        console.log(this.name);
      },
      say:()=>{
        console.log(this)
      }
    }
    return obj;
  }

  const o1 = createObj("admin", 18, "男");
  const o2 = createObj("张三", 20, "女");

  console.log(o1);
  console.log(o2);

  o1.show()
  o2.show()

  o1.say()
  
</script>
</html>